package com.practice.jdbc;

import com.practice.entity.Employee;

import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;

public class TestJDBCTemplate {
    public static void main(String[] args) {
        JDBCTemplate jdbcTemplate = new JDBCTemplate();
        try {
            Employee employee = jdbcTemplate.queryForObject(
                    "select * from employee where id = ?",
                    new Object[]{1},
                    Employee.class
            );
            System.out.println(employee);
        }catch (SQLException | InvocationTargetException | NoSuchMethodException | InstantiationException |
                IllegalAccessException e){
            e.printStackTrace();
        }
    }
}
